package com.szrt.spring.ch09.student.service.impl;

import com.szrt.spring.ch09.student.dao.StudentDao;
import com.szrt.spring.ch09.student.service.StudentService;

public class StudentServiceImpl implements StudentService {
	
	
	private StudentDao studentDao;
	
	private String studentName;
	
	
	/**
	 * 使用构造方法注入bean
	 * @param studentDao
	 * @param studentName
	 */
	public StudentServiceImpl(StudentDao studentDao, String studentName) {
		System.out.println("使用构造方法注入bean...");
		this.studentDao = studentDao;
		this.studentName = studentName;
		
		System.out.println(this.studentDao + ":"+ this.studentName);
	}



	@Override
	public void save() {
		
		studentDao.save();
	}





	
	
	
}
